<?php include("src/updateContractCompany_cs.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href='css/coolMessage.css' type='text/css' rel='stylesheet' media='screen' />
<title>Actualizar Contrato Compania :: ASSC</title>
<link rel="stylesheet" type="text/css" media="all" href="includes/calendario/calendar-system.css" title="system" />
<script type="text/javascript" src="includes/calendario/calendar.js"></script>
<script type="text/javascript" src="includes/calendario/lang/calendar-es.js"></script>
<script type="text/javascript" src="includes/calendario/calendar-setup.js"></script>
<script language="javaScript" type="text/javascript" src="js/jquery.js"></script>
<script language="javaScript" type="text/javascript" src="js/jquery.simplemodal.js"></script>
<script language="javaScript" type="text/javascript" src="js/coolMessage.js"></script>
<script language="javascript" type="text/javascript">
	
	var displayRow = '';
	if (navigator.appName == "Netscape")
		displayRow = 'table-row';
	else if (navigator.appName.indexOf("Explorer") != -1) 
		displayRow = 'block';
	

	
	function showMessage(show_msg){
		switch(show_msg){
			case 1://error
				coolMessage('error',"<?php echo $_SESSION["msg_cool"];?>");
			break;
			
			case 2://alert
				coolMessage('alert',"<?php echo $_SESSION["msg_cool"];?>");
			break;
			
			case 3://information
				coolMessage('information',"<?php echo $_SESSION["msg_cool"];?>");
			break;
			
			default:
				
			break;
		}
		return false;
	}
	
	function validate(){
		var msg    = '';
		
		var hdvc_code   			= document.getElementById("hdvc_code").value;
		var coco_type		= document.getElementById("coco_type").value;
		var coco_value   		= document.getElementById("coco_value").value;
		var coco_pay   		= document.getElementById("coco_pay").value;
		var coco_pay_value    		= document.getElementById("coco_pay_value").value;
		var coco_date_in		= document.getElementById("coco_date_in").value;
	
		if(hdvc_code == '') 
			msg='- Por favor escoja nombre de la compania. <br />';
			
		if(coco_type == '') 
			msg='- Por favor entre el tipo de contrato. <br />';	
		
		if(coco_value == '') 
			msg='- Por favor entre el valor de contrato. <br />';
			
		if(coco_pay == '') 
			msg='- Por favor entre periodo de pago. <br />';
			
		if(coco_pay_value == '') 
			msg= msg+'- Por favor entre valor. <br />';
			
		if(coco_date_in == '') 
			msg= msg+'- Por favor entre fecha de contrato. <br />';	

		
		if(msg==''){
			document.getElementById('form').submit();
			return true;
		}
		else{
			alert(msg);
			return false;
		}		
	}
	

	
	function onlyNumbers(e)
	{
	   var key;
	   if(window.event)
		  key = window.event.keyCode;   //IE
	   else
		  key = e.which;                //firefox
	   if (!( (key >= 48 && key <= 57) || key ==8 || key ==9 || key ==0 || key ==46 ))
		  return false;
	   else
		  return true;
	}	
	
	

</script>
</head>
<body onload="javascript: showMessage(<?php echo $show_msg;?>)">
<?php $item_select = 13; include("menu.php");?><br />
    <form name="form" id="form" method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="edit" id="edit" value="1"/>
    <input type="hidden" name="coco_code" id="coco_code" value="<?php echo $coco_code;?>" />
    <div class="content_grv">
    	<table width="80%" align="center" class="shadow">
        	<tr>
            	<td class="title">Editar Contrato Compania</td>
            </tr>
            <tr>
            	<td>
                	<table class="tbl_form" align="center">
                         <tr>
                            <td align="right"><span class="lbl_gray">Compania:</span></td>
                            <td>&nbsp;</td>
                            <td>
                                <select name="hdvc_code" id="hdvc_code" class="text_grv">
                                <?php 
                                for($i=0; $i<count($company);$i++) 
                                {
                                $select = '';
                                if($data->hdvc_code==$company[$i]->hdvc_code) 
                                    $select = 'selected="selected"';
                              	?>
                                
                                <option value="<?php echo $company[$i]->hdvc_code;?>" <?php echo $select;?>><?php echo $company[$i]->hdvc_name;?></option>
                                <?php }?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                        	<td width="35%" align="right"><span class="lbl_gray">Tipo:</span></td>
                            <td width="1%">&nbsp;</td>
                            <td><select name="coco_type" id="coco_type" class="text_grv">
                                    <option value="" selected="selected" disabled="disabled">Seleccione..</option>
                                    <option value="Indefinido"<?php if($data->coco_type == "Indefinido") echo 'selected="selected"'; ?>>Indefinido</option>
                            	    <option value="Temporal"<?php if($data->coco_type == "Temporal") echo 'selected="selected"'; ?>>Temporal</option>
                                </select></td>
                        </tr>
                        <tr>
                        	<td align="right"><span class="lbl_gray">Valor Contrato:</span></td>
                            <td>&nbsp;</td>
                            <td><input type="text" name="coco_value" id="coco_value" class="text_grv" size="21" maxlength="20" value="<?php echo $data->coco_value;?>" /></td>
                        </tr>
                                          
                        <tr>
                        	<td align="right"><span class="lbl_gray">Periodo:</span></td>
                            <td>&nbsp;</td>
                            <td><select name="coco_pay" id="coco_pay" class="text_grv">
                                    <option value="" selected="selected" disabled="disabled">Seleccione..</option>
                                    <option value="Quincenal"<?php if($data->coco_pay == "Quincenal") echo 'selected="selected"'; ?>>Quincenal</option>
                                    <option value="Mensual"<?php if($data->coco_pay == "Mensual") echo 'selected="selected"'; ?>>Mensual</option>
                            	</select></td>
                        </tr>
                        <tr>
                        	<td align="right"><span class="lbl_gray">Valor :</span></td>
                            <td>&nbsp;</td>
                            <td><input type="text" name="coco_pay_value" id="coco_pay_value" class="text_grv" size="21" maxlength="20" value="<?php echo $data->coco_pay_value;?>" /></td>
                        </tr>
                        <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Fecha de Contrato:</span></td>
                                        <td>&nbsp;</td>
                                        <td><input name="coco_date_in" type="text" style="width:100px" readonly="readonly" id="coco_date_in" maxlength="45" class="text_grv"
				value="<?php if(isset($data)) echo cambiarFormatoFecha($data->coco_date_in,1)?>"/> 
			    <input name="imagea" type="image" id="calendar1" src="images/mostrar_calendario.png" align="absmiddle" width="18" height="16"/></td><script type="text/javascript">
						Calendar.setup({
						inputField : "coco_date_in",							
						ifFormat : "%d/%m/%Y",
						showsTime : false,
						button : "calendar1", 
						step : 1
						});
				</script>
                        </tr>
                        <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Fecha de Terminacion:</span></td>
                                        <td>&nbsp;</td>
                                        <td><input name="coco_date_out" type="text" style="width:100px" readonly="readonly" id="coco_date_out" maxlength="45" class="text_grv"
				value="<?php if(isset($data)) echo cambiarFormatoFecha($data->coco_date_out,1)?>"/> 
			    <input name="imagea" type="image" id="calendar2" src="images/mostrar_calendario.png" align="absmiddle" width="18" height="16"/></td><script type="text/javascript">
						Calendar.setup({
						inputField : "coco_date_out",							
						ifFormat : "%d/%m/%Y",
						showsTime : false,
						button : "calendar2", 
						step : 1
						});
				</script>
                        </tr>
                        <tr>
                        	<td align="right"><span class="lbl_gray">Administracion:</span></td>
                            <td>&nbsp;</td>
                            <td> $ <input type="text" name="coco_admin" id="coco_admin" class="text_grv" size="21" maxlength="20" value="<?php echo $data->coco_admin;?>" /></td>
                        </tr>
                        <tr>
                        	<td align="right"><span class="lbl_gray">Aporte Mutual:</span></td>
                            <td>&nbsp;</td>
                            <td> $ <input type="text" name="coco_aporte_mutual" id="coco_aporte_mutual" class="text_grv" size="21" maxlength="20" value="<?php echo $data->coco_aporte_mutual;?>" /></td>
                        </tr>
                        <tr>
                            <td align="right"><span class="lbl_gray">EPS:</span></td>
                            <td>&nbsp;</td>
                            <td>
                                <select name="eps_code" id="eps_code" class="text_grv">
                                <?php 
                                for($i=0; $i<count($eps);$i++) 
                                {
                                $select = '';
                                if($data->eps_code==$eps[$i]->eps_code) 
                                    $select = 'selected="selected"';
                              	?>
                                
                                <option value="<?php echo $eps[$i]->eps_code;?>" <?php echo $select;?>><?php echo $eps[$i]->eps_name;?></option>
                                <?php }?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td align="right"><span class="lbl_gray">ARP:</span></td>
                            <td>&nbsp;</td>
                            <td>
                                <select name="arp_code" id="arp_code" class="text_grv">
                                <?php 
                                for($i=0; $i<count($arp);$i++) 
                                {
                                $select = '';
                                if($data->arp_code==$arp[$i]->arp_code) 
                                    $select = 'selected="selected"';
                              	?>
                                
                                <option value="<?php echo $arp[$i]->arp_code;?>" <?php echo $select;?>><?php echo $arp[$i]->arp_name;?></option>
                                <?php }?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td align="right"><span class="lbl_gray">AFP:</span></td>
                            <td>&nbsp;</td>
                            <td>
                                <select name="afp_code" id="afp_code" class="text_grv">
                                <?php 
                                for($i=0; $i<count($afp);$i++) 
                                {
                                $select = '';
                                if($data->afp_code==$afp[$i]->afp_code) 
                                    $select = 'selected="selected"';
                              	?>
                                
                                <option value="<?php echo $afp[$i]->afp_code;?>" <?php echo $select;?>><?php echo $afp[$i]->afp_name;?></option>
                                <?php }?>
                                </select>
                            </td>
                        </tr>
                        <tr>
                        	<td align="right"><span class="lbl_gray">Representante :</span></td>
                            <td>&nbsp;</td>
                            <td><input type="text" name="coco_rep" id="coco_rep" class="text_grv" size="51" maxlength="50" value="<?php echo $data->coco_rep;?>" /></td>
                        </tr>
                        <tr>
                        	<td align="right"><span class="lbl_gray">Representante Cedula :</span></td>
                            <td>&nbsp;</td>
                            <td><input type="text" name="coco_rep_ced" id="coco_rep_ced" class="text_grv" size="51" maxlength="50" value="<?php echo $data->coco_rep_ced;?>" /></td>
                        </tr>
                        <tr>
                        	<td align="right"><span class="lbl_gray">Telefono 1 Representante :</span></td>
                            <td>&nbsp;</td>
                            <td><input type="text" name="coco_rep_tel1" id="coco_rep_tel1" class="text_grv" size="51" maxlength="50" value="<?php echo $data->coco_rep_tel1;?>" /></td>
                        </tr>
                        <tr>
                            <td align="right" valign="top"><span class="lbl_gray">Descripcion:</span></td>
                            <td>&nbsp;</td>
                            <td><textarea name="coco_description" id="coco_description" class="text_grv" cols="40" rows="7"><?php echo $data->coco_description;?></textarea></td>
                        </tr>
                        <tr>
                  		<tr>
                        	<td colspan="3" align="center">&nbsp;</td>
                        </tr>
                        <tr>
                        	<td colspan="3" align="center">
                            <input type="button" class="button_grv" value="Save" onclick="javascript: return validate();" />
                            <input type="button" class="button_grv" value="Cancel" onClick="javascript:window.history.back(-1);" /></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</form>    
</body>
</html>
<?php include('divscoolmessage.php');?>